class Singleton
{
private:
	static Singleton* _ins;                     
	static mutex _imtx;     

    Singleton(){}                           //单例模式
	Singleton(const Singleton&)= delete;
public:
	static Singleton* GetInstance()
	{
		// 双检查加锁
		if (_ins == nullptr)
		{
			_imtx.lock();
			if (_ins == nullptr)
			{
				_ins = new Singleton;
			}
			_imtx.unlock();
		}

		return _ins;
	}
};

Singleton* Singleton::_ins = nullptr;
mutex Singleton::_imtx;